<?php
	$item_url = $_GET['var2'];
	$re_item = $db->select("select * from tip_item where titleurl = '$item_url' ");	
	$tt_item = $db->fetch($re_item);
	
	$sql_list = "select * from tip_item where id NOT IN ( ". $tt_item['id'] ." ) order by orderId, id desc limit 4";
	$qr_list = $db->select($sql_list);	
?>
<div class="w700">
    <div class="title"><?= $co_tip['titlemenu' . $hg] ?></div>
    <div class="news-detail">
        <div class="tit"><?=$tt_item['title'.$hg]?></div>
        <div class="content">
            <?=$tt_item['content'.$hg]?>
        </div>
        
        <div class="other">
            <div class="tit" ><?= ($hg == "")?'Other tips':'Các tin khác' ?></div>
            <ul>
                <?php
					while ($tt_list_other = $db->fetch($qr_list)) {
				?>
                <li><a href="<?= APPLICATION_URL ?>tip-detail/<?= $tt_list_other['titleurl'] ?>.html"><?= $tt_list_other['title' . $hg] ?></a></li>
				<?php
					}
				?>
            </ul>
        </div>
    </div>

</div>
<div class="w260 ml20">
    <div class="title"><?= $co_media['titlemenu' . $hg] ?></div>
    <ul class="s-list">
        <?php
        $sql = $db->select("select * from media_item order by orderId asc, id asc limit 3");
        ?>
        <?php while ($item = $db->fetch($sql)) : ?>
            <li>
                <a class="various fancybox.iframe" href="http://www.youtube.com/embed/<?= getYoutubeIdFromUrl($item['linkto']) ?>?autoplay=1">
                    
                    <img class="image" src="http://img.youtube.com/vi/<?= getYoutubeIdFromUrl($item['linkto']) ?>/0.jpg" />
                    <div class="desc">
                        <?= $item['title'] ?>
                    </div>
                    <div class="clear"></div>
                </a>
            </li>
        <?php endwhile; ?>
    </ul>
</div>
